(function(){
    var ip = 'http://101.251.203.114/';
        // ip = 'http://localhost:2000/';
    try{
        if(!window.performance || !window.performance.timing || !window.performance.getEntries){
            //donot get data from browsers that doesnot support HTML5 API 
            return;
        }
        
        setTimeout(function(){
            var timing = window.performance.timing;
            var urlArgument = '';
            var entries = window.performance.getEntries();
            var maxDuration = 0;
            var logInfo = {};
            
            for(var x in timing){
                urlArgument += x + '=' + timing[x] + '&';
            }
            
            entries.forEach(function(entry){
                if(entry.duration > maxDuration){
                    maxDuration = entry.duration;
                }
            });

            urlArgument += 'maxDuration=' + maxDuration;
            
            var newGif = new Image();
            newGif.src = ip + "logs?type=staticLog&clientType=nebula-portal-fe"  + urlArgument;
        },2000);
    }
    catch(err){
        setTimeout(function(){
            var newGif = new Image();
            newGif.src = ip + "logs?type=staticLog&clientType=nebula-portal-fe&error=notSupport";
        },2000);
    }
})();